<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
    <title>夏日猜涨跌</title>
    <link rel="stylesheet" type="text/css" href="./css/reset.css">
    <link rel="stylesheet" type="text/css" href="./css/index.css">

</head>
<script src="./js/jquery-2.2.2.min.js"></script>
<script type="text/javascript">
    function resRem(){//设置rem
        var deviceWidth = document.documentElement.clientWidth;
        document.documentElement.style.fontSize = deviceWidth / 7.5 + 'px';
    }
    resRem();
</script>
<script type="text/javascript" src="./js/jweixin-1.2.0.js"></script>
 <script>
     function getParams(str, name, defVal) {
         var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
         var r = str.substr(1).match(reg);
         return r ? unescape(r[2]) : (defVal != undefined ? defVal : null);
     }

     function GetQueryString(name)
     {
         var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
         var r = window.location.search.substr(1).match(reg);
         if(r!=null)return  unescape(r[2]); return null;
     }
//
     var appid = "";
     var timestamp = "";
     var noncestr = "";
     var signature = "";
     var search = window.location.href;
     var openId = GetQueryString("openid");

     var realUrl ="http://static.xyzq.cn/activity/guessUD/"
     var currentHref = window.location.href;
     var currentDomain = currentHref.split('?');


         $.ajax({
             type:"post",
             url:wxdataUrl+"/getWxInfo",
             data:{"url":realUrl},
             datatype:'json',
             async:false,
             success:function(data){
                 if (data.code>0) {
                     appid = data.data.appId;
                     timestamp = data.data.timestamp;
                     noncestr = data.data.nonceStr;
                     signature = data.data.signature;
                     console.log("appid: %s",appid);
                     console.log("timestamp: %s",timestamp);
                     console.log("noncestr: %s",noncestr);
                     console.log("signature: %s",signature);
                     // alert("appid: "+ appid);
                     //alert("timestamp: "+timestamp);
                     // alert("noncestr: "+noncestr);
                     //alert("signature: "+signature);

                     wx.config({
                         debug: false,
                         appId: appid,
                         timestamp: timestamp,
                         nonceStr: noncestr,
                         signature: signature,
                         jsApiList: [
                             // 所有要调用的 API 都要加到这个列表中
                             'onMenuShareTimeline',
                             'onMenuShareAppMessage',
                         ]
                     });
                 }

             }
         });
     wx.onMenuShareAppMessage({
                      title: '夏日猜涨跌', // 分享标题
                      desc: '夏日猜涨跌,7月25-8月24，赚大礼', // 分享描述
                      link: 'http://static.xyzq.cn/activity/guessUD/index-wechat.html', // 分享链接
                      imgUrl: 'http://static.xyzq.cn/activity/guessUD/'+'images/guessUD-pic.jpg', // 分享图标
                      type: '', // 分享类型,music、video或link，不填默认为link
                      dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                      success: function () {
                          // 用户确认分享后执行的回调函数
                      },
                      cancel: function () {
                          // 用户取消分享后执行的回调函数
                      }
                  });
          //分享到朋友圈
          wx.onMenuShareTimeline({
              title: '夏日猜涨跌',
              desc: '夏日猜涨跌,7月25-8月24，赚大礼', // 分享描述
              link: 'http://static.xyzq.cn/activity/guessUD/index-wechat.html',
              imgUrl: 'http://static.xyzq.cn/activity/guessUD/'+'images/guessUD-pic.jpg', // 分享图标
              type: '', // 分享类型,music、video或link，不填默认为link
              dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
              success: function (res) {
                  alert("ok");
              },
              cancel: function () {
                  // 用户取消分享后执行的回调函数
              }
          });


</script>

<body>
    <!--<div id="wx_pic" style="display:none;">-->
        <!--<img src="./images/guessUD-pic.jpg" alt="">-->
    <!--</div>-->
    <div class="page_container">
        <!-- 头部 -->
        <header>
            <!-- 头部 背景 -->
            <img src="./images/bg.png" alt="">
            <!-- 分享 + 签到 -->
            <div class="link">

                <a href="javascript:void(0)" id="sign"><img src="./images/签到btn.png" alt="" /></a>
            </div>
        </header>
        <!-- 主体 -->
        <main>
            <!-- 看涨跌 -->
            <div class="guess">
                <div class="container">
                    <!-- 猜涨跌 -->
                    <div class="gs_guess pr">
                        <!-- 进行中 -->
                        <div class="ing">
                            <!-- 涨 / 跌 -->
                            <div class="UorD clearfix">
                                <div class="left fl">
                                    <div class="img">
                                        <img src="./images/金币-涨.png" alt="">
                                    </div>
                                    <p class="data"><span class="ing_Urate">50</span>%的人猜涨</p>
                                    <a class="ing_isBet" id="guess_U" href="javascript:void(0);">
                                        <img src="./images/我看涨@3x.png" alt="">
                                    </a>
                                    <a class="ing_noBet" id="ing_UD" href="javascript:void(0);">
                                        <img src="./images/我看涨.png" alt="">
                                    </a>
                                </div>
                                <div class="right fr">
                                    <div class="img">
                                        <img src="./images/金币-跌.png" alt="">
                                    </div>
                                    <p class="data"><span class="ing_Drate">50</span>%的人猜跌</p>
                                    <a class="ing_isBet" id="guess_D" href="javascript:void(0);">
                                        <img src="./images/我看跌@3x.png" alt="">
                                    </a>
                                    <div class="my_guess ing_noBet">投注数量：<span id="ing_scoreNum">1</span>个筹码</div>
                                </div>
                            </div>
                            <!-- 截止时间 -->
                            <p class="end_time"><span class="ing_data"></span></p>
                        </div>
                        <!-- 已结束 -->
                        <div class="end">
                            <!-- 已投注 -->
                            <div class="have_result">
                                <div class="clearfix">
                                    <div class="left"><img id="have_result_img" src="./images/金币-涨.png" alt=""></div>
                                    <div class="right fl">
                                        <div><span class="end_data">7月16日</span>沪指<i id="have_result_i">涨</i>了</div>
                                        <div><span id="have_result_rate">65%</span>的人猜对</div>
                                        <div>本期赔率<span id="end_odds">1:5</span></div>
                                    </div>
                                </div>
                                <div class="description clearfix">
                                    <div class="img fl"><img id="have_result_dimg" src="./images/zan.png" alt=""></div>
                                    <div id="have_result_description" class="fl">
                                        <div>股神，恭喜你赢得了<span id="have_result_jetton">5</span>个筹码</div>
                                        <div>你看<i id="have_result_UD">涨</i>，投注数量：<span><i id="have_result_scoreNum">10</i>个筹码</span></div>
                                    </div>
                                </div>
                                <div class="end_time"><span class="ing_data">7月17日</span>12:59截止</div>
                            </div>
                            <!-- 未投注没结果 -->
                            <div class="no_result">
                                <div class="question"><span class="ing_data">7月17日</span>沪指是涨是跌？</div>
                                <!-- 涨 / 跌 -->
                                <div class="UorD clearfix">
                                    <div class="left fl">
                                        <div class="img">
                                            <img id="no_result_img" src="./images/金币-涨.png" alt="">
                                        </div>
                                        <p class="data"><span class="end_Urate">37</span>%的人猜涨</p>
                                        <a class="end_noBet" id="no_result_UD" href="javascript:void(0);">
                                            <img src="./images/我看涨.png" alt="">
                                        </a>
                                    </div>
                                    <div class="right fr">
                                        <div class="img">
                                            <img src="./images/金币-跌.png" alt="">
                                        </div>
                                        <p class="data"><span class="end_Drate">37</span>%的人猜跌</p>
                                        <div class="my_guess end_noBet">投注数量：<span id="no_result_scoreNum">1</span>个筹码</div>
                                    </div>
                                </div>
                                <!-- 我猜的 -->
                                <!-- 截止时间 -->
                                <p class="end_time"><span class="ing_data">7月17日</span>12:59公布结果</p>
                            </div>
                        </div>
                    </div>
                    <!-- 其他人的猜测情况 -->
                    <div class="others">
                        <div class="container">
                            <ul id="guess_others_ul">
                                <!-- 看涨样式 -->
                                <li class="bearish clearfix">
                                    <div class="others_time">13:34:23</div>
                                    <div class="others_judge"><i class="img"><img src="./images/上涨.png" alt=""></i> 看涨</div>
                                    <div class="tel">169****0022</div>
                                    <div class="get">10个筹码</div>
                                </li>
                                <!-- 看跌样式 -->
                                <li class="bullish clearfix">
                                    <div class="others_time">13:35:00</div>
                                    <div class="others_judge"><i class="img"><img src="./images/下跌.png" alt=""></i> 看跌</div>
                                    <div class="tel">158****0614</div>
                                    <div class="get">20个筹码</div>
                                </li>
                                <li class="bearish clearfix">
                                    <div class="others_time">13:42:21</div>
                                    <div class="others_judge"><i class="img"><img src="./images/上涨.png" alt=""></i> 看涨</div>
                                    <div class="tel">159****1993</div>
                                    <div class="get">10个筹码</div>
                                </li>
                                <li class="bullish clearfix">
                                    <div class="others_time">13:43:23</div>
                                    <div class="others_judge"><i class="img"><img src="./images/下跌.png" alt=""></i> 看跌</div>
                                    <div class="tel">189****0146</div>
                                    <div class="get">10个筹码</div>
                                </li>
                                <li class="bullish clearfix">
                                    <div class="others_time">14:45:09</div>
                                    <div class="others_judge"><i class="img"><img src="./images/下跌.png" alt=""></i> 看跌</div>
                                    <div class="tel">139****4319</div>
                                    <div class="get">30个筹码</div>
                                </li>
                                <li class="bearish clearfix">
                                    <div class="others_time">15:09:20</div>
                                    <div class="others_judge"><i class="img"><img src="./images/上涨.png" alt=""></i> 看涨</div>
                                    <div class="tel">139****6013</div>
                                    <div class="get">10个筹码</div>
                                </li>
                                <li class="bearish clearfix">
                                    <div class="others_time">15:18:11</div>
                                    <div class="others_judge"><i class="img"><img src="./images/上涨.png" alt=""></i> 看涨</div>
                                    <div class="tel">147****0122</div>
                                    <div class="get">10个筹码</div>
                                </li>
                                <li class="bullish clearfix">
                                    <div class="others_time">15:50:10</div>
                                    <div class="others_judge"><i class="img"><img src="./images/下跌.png" alt=""></i> 看跌</div>
                                    <div class="tel">187****9750</div>
                                    <div class="get">100个筹码</div>
                                </li>
                                <li class="bearish clearfix">
                                    <div class="others_time">15:53:10</div>
                                    <div class="others_judge"><i class="img"><img src="./images/上涨.png" alt=""></i> 看涨</div>
                                    <div class="tel">183****0790</div>
                                    <div class="get">10个筹码</div>
                                </li>
                                <li class="bearish clearfix">
                                    <div class="others_time">15:59:23</div>
                                    <div class="others_judge"><i class="img"><img src="./images/上涨.png" alt=""></i> 看涨</div>
                                    <div class="tel">177****3456</div>
                                    <div class="get">30个筹码</div>
                                </li>
                                <li class="bullish clearfix">
                                    <div class="others_time">16:01:23</div>
                                    <div class="others_judge"><i class="img"><img src="./images/下跌.png" alt=""></i> 看跌</div>
                                    <div class="tel">139****2357</div>
                                    <div class="get">30个筹码</div>
                                </li>
                                <li class="bearish clearfix">
                                    <div class="others_time">16:12:11</div>
                                    <div class="others_judge"><i class="img"><img src="./images/上涨.png" alt=""></i> 看涨</div>
                                    <div class="tel">130****5645</div>
                                    <div class="get">30个筹码</div>
                                </li>
                                <li class="bullish clearfix">
                                    <div class="others_time">16:20:21</div>
                                    <div class="others_judge"><i class="img"><img src="./images/下跌.png" alt=""></i> 看跌</div>
                                    <div class="tel">136****2754</div>
                                    <div class="get">30个筹码</div>
                                </li>
                                <li class="bearish clearfix">
                                    <div class="others_time">16:27:32</div>
                                    <div class="others_judge"><i class="img"><img src="./images/上涨.png" alt=""></i> 看涨</div>
                                    <div class="tel">138****3145</div>
                                    <div class="get">500个筹码</div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </main>
        <!-- 底部 -->
        <footer>
            <!-- 活动规则 -->
            <div class="rule">
                <h2>活动规则</h2>
                <h4>A. 游戏时间</h4>
                <p> T-1日13:00-T日12:59（非交易日都为游戏时间），兴证通客户可以竞猜T日上证指数涨跌方向（指数持平视为涨）。</p>
                <h4>B.  游戏筹码</h4>
                <p> 用户在竞猜时间，投入游戏筹码，即可参与竞猜，单次游戏投入筹码数量为10个及其整数倍，赔率按T日收盘胜负双方的积分比率计算。</p>
                <h4>C.  游戏筹码获取途径</h4>
                <p> a）完成两融征信，赠送500个筹码；开通两融账号，再赠送1000个筹码；</p>
                <p>b）每天到活动页点击签到，即可获得10个筹码奖励，当天到账；</p>
                <p>c）参与本活动，如猜对方向，会根据投注数量获得相应比例的筹码奖励。</p>
                <h4>D.  游戏奖励</h4>
                <p> 每日结算后，根据用户投入筹码数量和指数涨跌情况向所有猜对用户发放筹码奖励。用户可在“我的战绩”中查看游戏筹码奖励到账和每期盈亏情况，实际奖励（四舍五入取整）将在每个交易日结果公布后一个工作日内到账。</p>
                <h4>E.  奖励兑换</h4>
                <div class="table clearfix">
                    <div class="left fl">
                        <div class="thead">虚拟物奖励</div>
                        <div class="tbody">
                            100个筹码 <br>
                            200个筹码 <br>
                            500个筹码 <br>
                            700个筹码 <br>
                            1300个筹码
                        </div>
                    </div>
                    <div class="right fl">
                        <div class="thead">等值实物奖励</div>
                        <div class="tbody">
                            30M流量 <br>
                            "融夺标"月卡<br>
                            融资优惠利率7.99% <br>
                            优酷会员月卡 <br>
                            优酷会员年卡
                        </div>
                    </div>
                </div>
                <p class="tx_in0">1次签到=10个筹码，所有兑换仅限至少参与过3次投注的用户；<br />
                各档产品均可兑换，每档产品限兑换一次；<br />
                "融夺标"月卡的兑换仅针对活动前已开通两融账号的客户，活动结束前兑换有效；<br />
                实物奖励将在活动结束后14个工作日内派发到兴证通对应的手机号；<br />
                融资优惠利率兑换每日限量50个，需在活动结束前兑换有效，兑换后需在9月29日前成功开通两融账号，过期失效。</p>
                <h4>F.  参与次数</h4>
                <p>单个游戏时间内每个用户仅可参与游戏1次，同一手机号、兴证通账号视为同一用户。</p>
                <h4>G.  免责声明</h4>
                <p>a）同一手机号、兴证通号均视为同一用户,若存在任何作弊行为的用户,兴业证券将取消其参与资格,已经发放奖品的有权收回奖品；</p>
                <p>b）用户需确保兴证通账号内有足额的游戏筹码，若账号内筹码少于当期参与数量，则奖励不会派发；</p>
                <p>c）请确保网络和系统通畅,若因网络原因或系统原因,造成游戏中断、奖励未到账的情况，兴业证券将不再补发奖励；</p>
                <p>d）用户参与活动，即视为同意以上活动规则和免责声明；</p>
                <p>e）本次活动最终解释权归兴业证券股份有限公司所有，如有疑问，请拨打客服热线：<a href="wtai://wp/mc;[95562]">95562</a>。</p>
            </div>
        </footer>
        <!-- 浮层 -->
        <div class="supernatant">
            <!-- 前往APP浮层 -->
            <div class="toAPP_supernatant shade_supernatant">
                <div class="container container_supernatant">
                    <div class="top-three"></div>
                    <div class="description">活动在兴业证券<br />优理宝APP内参与噢~</div>
                    <a class="js-download" onclick="check_brower();" href="javascript:void(0);">立即前往</a>
                    <div class="close_supernatant"><img src="./images/关闭.png" alt=""></div>
                </div>
            </div>
        </div>
    </div>
    <div id="ydc" class="ydc">选择在浏览器中打开进行下载</div>
</body>

<script src="./js/template.js"></script>
<script src="./js/td-h5-website-sdk-3.1.2.js"></script>
<script>


    /*封装tap*/
    function tap(dom,callback){
        /*
         * 要求  没有触发 touchmove 事件
         *       并且响应速度要比click快
         */
        if(dom && typeof  dom == 'object'){
            var isMove = false;
            var startTime = 0;
            dom.addEventListener('touchstart',function(e){
                //console.log('touchstart');
                //console.time('tap');/*记录tap这个参数现在的时间*/
                startTime = Date.now();
            });
            dom.addEventListener('touchmove',function(e){
                //console.log('touchmove');
                isMove = true;
            });
            dom.addEventListener('touchend',function(e){
                //console.log('touchend');
                //console.timeEnd('tap')/*打印tap这个参数距离上一次记录的时候的时间*/
                /*判读  是否满足tap 的要求  一般要求tap的响应时间150*/
                if(!isMove && (Date.now()-startTime) < 150){
                    /*调用 callback*/
                    callback && callback(e);
                }
                /*重置 参数*/
                isMove = false;
                startTime = 0;
            });
        }
    }

//全局点击显示立即前往弹窗
    tap($('body')[0],function(){
            $('.supernatant .toAPP_supernatant').show();
        });
        // 关闭按钮
        $('.supernatant .close_supernatant').each(function () {
            $(this).on('click', function () {
                $(this).parent('div').parent('div').hide()
            })
        });

//    下载app
    function getParams(str, name, defVal) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = str.substr(1).match(reg);

        return r ? unescape(r[2]) : (defVal != undefined ? defVal : null);
    }
    var url = window.location.href;

    var param= getParams("channel");

    $(function(){
        $(".js-download").click(function(){
            openTip();
            TDAPP.onEvent("猜涨跌_下载优理宝","",{});
        })
    });

    function openTip(){
        document.getElementById("ydc").style.display="block";
    }

    document.getElementById("ydc").onclick=function(){
        document.getElementById("ydc").style.display="none";
    };


    function isweixin(){
        var ua = navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i)=="micromessenger") {
            return true;
        } else {
            return false;
        }
    }

    var browser = {
        versions: function () {
            var u = navigator.userAgent, app = navigator.appVersion;
            return { //移动终端浏览器版本信息
                ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                android: u.indexOf('Android') > -1 ||  u.indexOf('android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
                iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
                iPad: u.indexOf('iPad') > -1 //是否iPad
            };
        }()
    };
    function check_brower(){

        if(isweixin()){ //判断是否是微信中打开的，若是则提示用户使用浏览器打开，才能下载
            openTip();
            return;
        }

        var iosResUrl_ulb = "https://itunes.apple.com/cn/app/you-li-bao-jin-rong-zhong-duan/id645811920?ls=1&mt=8";
        //  var ipadResUrl_ulb = "https://itunes.apple.com/cn/app/xing-ye-zheng-quan-you-li-baohd/id496762629?ls=1&mt=8";
        var andResUrl_ulb = "http://download.xyzq.com.cn/files/xyd/xyzq_mobile_2.7.0.apk";
        var wphResUrl_ulb = "http://www.windowsphone.com/s?appid=876df810-57e8-454e-8e3a-4052200c6308";

        var u = navigator.userAgent;

        //是否是iphone
         if (browser.versions.iPhone) {
             window.location.href=iosResUrl_ulb;
             postpiwik(pagePre+'iPhone_优理宝下载',iosResUrl_ulb);

         }else if(browser.versions.iPad){//是否是ipad
             window.location.href = iosResUrl_ulb;
             postpiwik(pagePre+'iPad_优理宝下载',iosResUrl_ulb);

         }else if(browser.versions.android){ //是否是android
             window.location.href =andResUrl_ulb;
             postpiwik(pagePre+'adnroid_优理宝下载',andResUrl_ulb);

         }else if(u.indexOf('Windows Phone') > -1){ //是否是winphone
             window.location.href =wphResUrl_ulb;
             postpiwik(pagePre+'winphone_优理宝下载',wphResUrl_ulb);

         }else{ //其他
             window.location.href  = andResUrl_ulb;
             postpiwik(pagePre+'其它_优理宝下载',andResUrl_ulb);
         }
     }

     // 页面数据滚动部分

    var a=$("#guess_others_ul").clone(true);
    $(".others").append(a);
    var num=-1;
    var height = $('#guess_others_ul li')[0].offsetHeight * 5;
    console.log(height);
    $('.guess .others').css('max-height', height);
    setInterval(function(){

        $("#guess_others_ul").css({
            "transform": "translateY("+num+"px)"
        });
        num-=1;
        if(num<-300){
            var a=$("#guess_others_ul").get(0);
            $("#guess_others_ul").append(a);
            num=-1;
        }
    },30)


</script>
</html>